﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PostStudentScore.aspx.cs" Inherits="Web.PostStudentScore" %>
<%@ Register TagPrefix="uc1" TagName="TopMenu" Src="TopMenu.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Floor" Src="Floor.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>成绩录入</title>
    <link href="css/style.css" rel="stylesheet" type="text/css" />
    <script src="js/jquery-1.3.2.min.js" type="text/javascript"></script>
</head>
<body>
    <uc1:TopMenu id='menu1' runat='server'></uc1:TopMenu>
    <form id="form1" runat="server">
    <div id="main">
        <div id="mainleft">
        <div id="block">
        <h3 id="blocktitle"><asp:RadioButton ID="NewStudent" runat="server" GroupName="SelectOrNew"/>新建学员信息</h3>
        <div id="blockcontent">
            <div class="formdiv">学号：<asp:TextBox ID="StuNumber" runat="server"></asp:TextBox></div>
            <div class="formdiv">姓名：<asp:TextBox ID="StuName" runat="server"></asp:TextBox></div>
            <div class="formdiv">性别：<asp:RadioButton ID="Sex0" runat="server" Text="女" 
                    Checked="True" GroupName="Sex" /><asp:RadioButton ID="Sex1" runat="server" 
                    Text="男" GroupName="Sex"/></div>
            <div class="formdiv">学科类型：
                <asp:DropDownList ID="subjectType" runat="server">
                </asp:DropDownList>
            </div>  
            <div class="formdiv">生源类型：
                <asp:DropDownList ID="sourceType" runat="server">
                </asp:DropDownList>
            </div>                           
        </div>
        <h3 id="blocktitle"><asp:RadioButton ID="SelectStudent" runat="server" GroupName="SelectOrNew"/>选择学员信息（选择一个学员）</h3>
        <div id="blockcontent">
            <asp:CheckBoxList ID="StudentList" runat="server">
            </asp:CheckBoxList>
        </div>
        </div>
        </div>
        <div id="mainright">
        <div id="block">
        <h3 id="blocktitle">考试信息</h3>
        <div id="blockcontent">
            <div class="formdiv">考试名称：
                <asp:DropDownList ID="ExamRoomList" runat="server" 
                    onselectedindexchanged="ExamRoomList_SelectedIndexChanged"></asp:DropDownList></div>
            <div class="formdiv">选择年级：
                <asp:DropDownList ID="GradeList" runat="server" 
                    onselectedindexchanged="GradeList_SelectedIndexChanged" 
                    AutoPostBack="True"></asp:DropDownList></div>
            <div class="formdiv">选择班级：
                <asp:DropDownList ID="ClassList" runat="server" 
                    onselectedindexchanged="ClassList_SelectedIndexChanged" 
                    AutoPostBack="True">
                </asp:DropDownList></div>
        </div>
        <h3 id="blocktitle">成绩答案 （<input id="IsShowAnswer" type="checkbox" />录入答案）</h3>
        <div id="blockcontent">
            <ul id='inputscore'>
                <asp:Label ID="TempList" runat="server"></asp:Label>
            </ul>
        </div>
        </div>
        </div>
        <div id="blockfloor" style="text-align:center;">
        <asp:Button ID="Button1" runat="server" Text="保存" onclick="Button1_Click" /></div>
    </div>
    </form>
    <uc1:Floor id='Floor1' runat='server'></uc1:Floor>
</body>
<script type="text/javascript">
    $(document).ready(function() {
        $(".Answer").hide();
        $("#StuNumber").bind("focus", function() {
            $("#NewStudent").attr("checked", "true");
        });
        $("#StudentList").bind("click", function() {
            $("#SelectStudent").attr("checked", "true");
        });
        $("input:checkbox").bind("click", function() {
            if ($("input:checkbox[checked = true]").size() > 1) {
                return false;
            }
        });
        $("#IsShowAnswer").bind("click", function() {
            if ($("#IsShowAnswer").attr("checked")) {
                $(".Answer").show();
            }
            else {
                $(".Answer").hide();
            }
        });
        $("body").live("keydown", function() {
            if (window.event.keyCode == 13) {
                window.event.keyCode = 9;
            }
        });
        $("#Button1").bind("click", function() {
            if ($("#NewStudent").attr("checked") == false && $("#SelectStudent").attr("checked") == false) {
                alert("没有选择学生！");
                return false;
            }
            if ($("#ClassList").val() == "0") {
                alert("没有选择班级！");
                return false;
            }
            if ($("#NewStudent").attr("checked") == true) {
                if ($("#StuNumber").val() == "" || $("#StuName").val() == "") {
                    alert("学号或学生姓名不能为空！");
                    return false;
                }
            }
        });
    });
    function clearNoNum(obj) {
        obj.value = obj.value.replace(/[^\d.]/g, "");
        obj.value = obj.value.replace(/^\./g, "");
        obj.value = obj.value.replace(/\.{2,}/g, ".");
        obj.value = obj.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
    }
</script>
</html>
